namespace XEAS.Framework.eCommerce.Paypal
{
    using System;
    using System.Text;

    public class PayPalAccessLayer
    {
        public static string GetPayPalPaymentUrl(bool demoMode, string completeUrl, string cancelUrl, string notifyUrl, string payPalBusinessEmail, string productName, decimal productID, decimal amount, decimal shippingFee, string currency)
        {
            string str = demoMode ? "https://www.sandbox.paypal.com/us/cgi-bin/webscr" : "https://www.paypal.com/us/cgi-bin/webscr";
            string str2 = amount.ToString("N2").Replace(',', '.');
            string str3 = shippingFee.ToString("N2").Replace(',', '.');
            StringBuilder builder = new StringBuilder();
            builder.AppendFormat("{0}?cmd=_xclick&upload=1&rm=2&no_shipping=1&no_note=1&currency_code={1}&business={2}&item_number={3}&custom={3}&item_name={4}&amount={5}&shipping={6}&notify_url={7}&return={8}&cancel_return={9}", new object[] { str, currency, payPalBusinessEmail, productID, productName, str2, str3, notifyUrl, completeUrl, cancelUrl });
            return builder.ToString();
        }
    }
}

